<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta name="renderer" content="webkit">
	<link rel="stylesheet" type="text/css" href="css/com.css"/>
	<link rel="stylesheet" type="text/css" href="css/login.css"/>
	<title>登陆</title>
    <script type="text/javascript">
    	
   		document.addEventListener('plusready', function(){
   			//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"
   			
   		});
   		
    </script>
</head>
<body>
<div class="login">
	<img src="img/login1.png" />
</div>	
     <from method="get" class="form-x" action="tocatuserlogin1">
		<div class="login_one" id="login_one" name="login_one">
			<div class="login_tow">
				<div class="login_th">
					<img src="img/loginname.gif" />
				</div>
				<input type="username" name="username" id="username" style="background: #fffff" placeholder="请输入账号" />
			</div>

			<div class="login_tow">
				<div class="login_th">
					<img src="img/loginpass.gif" />
				</div>
				<input type="password" name="password" id="password" style="background: #fffff" placeholder="请输入密码" />
			</div>
			
			
		</div>		
		<div class="login2" id="login2">
			<p><button  type="button" onclick="check1()" style="color: #fffff;background: #a7e7ff;border: hidden;width:100%">提交</button></p>
			<h5><a href="zhuce.html">登录遇见问题?</a></h5>
		</div>
	</from>		
		<div class="login3">
			-or-
		</div>
		<div class="login3">
			
			<a href=""><img src="img/loginqq.gif" /></a>
			<a href=""><img src="img/loginv.gif" /></a>
			<a href=""><img src="img/loginveibo.gif" /></a>
		</div>
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
	function check1(){
		var catuser_name = document.getElementById("username").value;
		var catuser_pass = document.getElementById("password").value;
		if(catuser_name == null || catuser_name == ""){
			alert("用户名不能为空");
			return;
		}
		if(catuser_pass == null || catuser_pass == ""){
			alert("密码不能为空");
			return;
		}
		$.ajax({
 			type:"POST",
 			url:"studentLogin",
 			data:({
 				sno:catuser_name,
 				password:catuser_pass
 			}),
 			success:function(data){
 				if(data!=null||data!=""){;
 					window.location.href="index.html";								
 				   }if(data==null||data=="" ){
 					  alert("用户名或者密码错误");
 					 window.location.href="login.html";	
 				}
 			}
 		});
		
}

</script>
</body>
</html>